Skip to content

fix: add result param to attemptCompletion and remove GeneratingRunResult#577

Merged
FL4TLiN3 merged 6 commits intomainfrom
fix/attempt-completion-strict-schema
Feb 19, 2026
Merged

fix: add result param to attemptCompletion and remove GeneratingRunResult#577
FL4TLiN3 merged 6 commits intomainfrom
fix/attempt-completion-strict-schema

Conversation

@FL4TLiN3
Copy link
Contributor

@FL4TLiN3 FL4TLiN3 commented Feb 18, 2026

Summary

  • Add optional result string parameter to attemptCompletion tool so the LLM provides its final response directly in the tool call
  • Complete runs directly from CallingMcpTools state, eliminating the extra LLM round-trip in GeneratingRunResult that was unreliable (often returning empty text for multi-modal tasks) and wasteful
  • Remove GeneratingRunResult state, attemptCompletion event type, and dead React event handling code
  • Update system prompt and E2E expert instructions to use the new result parameter

Test plan

  • pnpm typecheck — 23/23 packages pass
  • pnpm test — 1090/1090 unit tests pass
  • pnpm build — 23/23 packages build
  • pnpm format-and-lint — no new warnings
  • pnpm test:e2e — 76/76 E2E tests pass (including PDF and image multi-modal tests)

🤖 Generated with Claude Code

FL4TLiN3 and others added 4 commits February 18, 2026 21:15
…pletion path

- Change attemptCompletion inputSchema to z.object({}).strict() producing
  additionalProperties: false, preventing LLMs from passing args
- Remove extractTextFromLastMessage shortcut in CallingMcpTools; always
  transition to GeneratingRunResult for final text generation
- Revert "OK" fallback text in GeneratingRunResult
- Update E2E expert instructions to simple "Call attemptCompletion"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…letion

The terse "Call attemptCompletion" instruction caused LLMs to complete
without generating visible summary/description text, resulting in empty
completeRun text. Updated to explicitly request content generation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…mpty

When the LLM generates result text alongside the attemptCompletion tool
call, the follow-up LLM call in GeneratingRunResult (with tools:{}) often
returns empty text since the LLM has nothing more to add. Fall back to
extracting text from the last expert message in the checkpoint.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…sult

Add optional `result` string parameter to attemptCompletion so the LLM
provides its final response directly in the tool call, eliminating the
extra LLM round-trip in GeneratingRunResult that was unreliable
(often returning empty text) and wasteful.

- Add `result?: string` to attemptCompletion inputSchema
- Complete runs directly from CallingMcpTools (no GeneratingRunResult)
- Remove GeneratingRunResult state, attemptCompletion event type
- Remove dead attemptCompletion event handling in React utils
- Update system prompt and E2E instructions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@FL4TLiN3 FL4TLiN3 changed the title fix: enforce strict no-args schema on attemptCompletion and unify completion path fix: add result param to attemptCompletion and remove GeneratingRunResult Feb 18, 2026
…n-strict-schema

# Conflicts:
#	packages/runtime/src/state-machine/states/calling-mcp-tools.ts
#	packages/runtime/src/state-machine/states/generating-run-result.ts
@FL4TLiN3 FL4TLiN3 enabled auto-merge (squash) February 19, 2026 05:38
@FL4TLiN3 FL4TLiN3 merged commit 17e5c92 into main Feb 19, 2026
11 checks passed
@FL4TLiN3 FL4TLiN3 mentioned this pull request Feb 19, 2026
@FL4TLiN3 FL4TLiN3 deleted the fix/attempt-completion-strict-schema branch February 25, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant